﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ChoJu.Single.ViewModel;
using ChoJuRating.UcControl;

namespace ChoJu.Single.Views
{
    /// <summary>
    /// CollectView.xaml 的交互逻辑
    /// </summary>
    public partial class CollectView : UserControl
    {
        public CollectView()
        {
            InitializeComponent();

            this.DataContext = new CollectVM();
        }

        private void TextBox_GotFocus(object sender, RoutedEventArgs e)
        {
            Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render,
               new Action(() =>
               {
                   KeyboardView kb = new KeyboardView(((TextBox)sender).Text);
                   if (kb.ShowDialog() == false)
                       return;

                   ((TextBox)sender).Text = kb.Result;
               }));
        }
    }
}
